package com.elangzhi.ssm.model;

import com.elangzhi.ssm.model.base.BaseModel;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class Goods extends BaseModel {

    private Long id;

    /**
     * 商品名称
     */
    private String name;

    /**
     * 简介
     */
    private String intro;

    /**
     * 价格
     */
    private BigDecimal price;

    /**
     * 是否支持配送
     * 1，支持
     * 0，不支持
     */
    private Integer peiSong;

    /**
     * 是否支持全国快递
     * 1，支持
     * 0，不支持
     */
    private Integer kuaiDi;

    /**
     * 是否支持自提
     * 1，支持
     * 0，不支持
     */
    private Integer ziTi;

    /**
     * 是否包邮
     * 1，是
     * 0，否
     */
    private Integer baoYou;

    /**
     * 邮费
     * 包邮为0
     */
    private BigDecimal youPrice;

    /**
     * 排序，数值越大越靠前
     */
    private Integer sort;

    /**
     * 店铺id
     */
    private Long shopId;

    /**
     * 添加时间
     */
    private Date setTime;

    /**
     * 详细介绍 HTML内容
     */
    private String content;

    /**
     * 所属分类id
     */
    private Long typeId;

    //自定义列
    private Shop shop;
    private User user;
    private List<Image> bannerList;
    private List<GoodsComment> commentList;
    private List<ShopEvent> eventList;
    private String shopName; //店铺名称
    private String shopAddress;//店铺街道地址
    private String score;// 评论平均评分 5以内的小数
    private Collection collection; // 收藏信息，需要传输用户名

    private Integer collectionCount; //收藏总数
    private Integer payCount;// 购买总数


    public Goods() {
        super();
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Shop getShop() {
        return shop;
    }

    public void setShop(Shop shop) {
        this.shop = shop;
    }

    public Long getTypeId() {
        return typeId;
    }

    public void setTypeId(Long typeId) {
        this.typeId = typeId;
    }

    public Integer getCollectionCount() {
        return collectionCount;
    }

    public void setCollectionCount(Integer collectionCount) {
        this.collectionCount = collectionCount;
    }

    public Integer getPayCount() {
        return payCount;
    }

    public void setPayCount(Integer payCount) {
        this.payCount = payCount;
    }

    public Collection getCollection() {
        return collection;
    }

    public void setCollection(Collection collection) {
        this.collection = collection;
    }

    public List<ShopEvent> getEventList() {
        return eventList;
    }

    public void setEventList(List<ShopEvent> eventList) {
        this.eventList = eventList;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getPeiSong() {
        return peiSong;
    }

    public void setPeiSong(Integer peiSong) {
        this.peiSong = peiSong;
    }

    public Integer getKuaiDi() {
        return kuaiDi;
    }

    public void setKuaiDi(Integer kuaiDi) {
        this.kuaiDi = kuaiDi;
    }

    public Integer getZiTi() {
        return ziTi;
    }

    public void setZiTi(Integer ziTi) {
        this.ziTi = ziTi;
    }

    public Integer getBaoYou() {
        return baoYou;
    }

    public void setBaoYou(Integer baoYou) {
        this.baoYou = baoYou;
    }

    public BigDecimal getYouPrice() {
        return youPrice;
    }

    public void setYouPrice(BigDecimal youPrice) {
        this.youPrice = youPrice;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Date getSetTime() {
        return setTime;
    }


    public String getSetTime(String pattern) {
        if(setTime == null){ return ""; }
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
        return simpleDateFormat.format(setTime);
    }

    public void setSetTime(Date setTime) {
        this.setTime = setTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public List<Image> getBannerList() {
        return bannerList;
    }

    public void setBannerList(List<Image> bannerList) {
        this.bannerList = bannerList;
    }

    public List<GoodsComment> getCommentList() {
        return commentList;
    }

    public void setCommentList(List<GoodsComment> commentList) {
        this.commentList = commentList;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getShopAddress() {
        return shopAddress;
    }

    public void setShopAddress(String shopAddress) {
        this.shopAddress = shopAddress;
    }

    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

}